<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          >创建模板</el-button
        >
      </el-col>
    </el-row>
    <div v-loading="loading">
      <el-row :gutter="20">
        <el-col
          :xl="6"
          :lg="8"
          :sm="12"
          :xs="24"
          v-for="(item, index) of list"
          :key="index"
        >
          <item
            :item="item"
            @handleEdit="handleEdit"
            @handleCopy="handleCopy"
            @getList="getList"
          />
        </el-col>
      </el-row>
    </div>
    <intelligence-dialog
      :open="open"
      :title="title"
      @cancel="cancel"
      ref="child"
      @submitForm="submitForm"
    />
  </div>
</template>

<script>
import intelligenceDialog from "./components/intelligence-dialog";
import item from "./components/item";

export default {
  name: "posRent",
  data() {
    return {
      // 遮罩层
      loading: false,
      list: [{}, {}],
      title: "",
      open: false,
    };
  },
  components: {
    intelligenceDialog,
    item,
  },
  created() {},
  methods: {
    // 修改产品
    handleEdit(item) {
      this.title = "编辑智能体模板";
      this.open = true;
    },
    getList() {},
    handleAdd() {
      this.title = "创建智能体模板";
      this.open = true;
    },
    handleCopy(item) {
      this.title = "创建智能体模板";
      this.open = true;
    },
    cancel() {
      this.open = false;
    },
    rest() {
      this.$refs.child.resetFormFun();
    },
    submitForm() {
      console.log("submitForm");
    },
  },
};
</script>

<style scoped></style>
